<template>
    <div class="record-pro-outer">
    	<portlet name="产品使用汇总" :link="more">
        	<i-table :columns="columns1" :data="data1"></i-table>
        </portlet>
    </div>
</template>
<script>
	import Portlet from '../../components/portlet.vue';
    export default {
    	components:{ Portlet },
        data () {
            return {
                more:{
                    text:'更多  >',
                    addr:'/app/center/query'
                },
                columns1: [
                    {
                        title: '产品名称',
                        key: 'companyName',
                        width:110,
                    },
                    {
                        title: '产品编码',
                        key: 'companyCode',
                        width:120,
                    },
                    {
                        title: '成功条数',
                        key: 'success_count',
                    },
                    {
                        title: '失败条数',
                        key: 'failed_count',
                    },
                    {
                        title: '总条数',
                        key: 'all_count',
                    },
                    {
                        title: '总金额',
                        key: 'money',
                    }
                ],
                data1: [
                    
                ]
            }
        },
        methods: {

        },
        ready(){
            this.$nextTick(()=>{
                this.$http.jsonp(this.path+'consump/consumpServlet/transStatisticsList',{
                    jsonp:'callback'
                }).then(
                    (datas)=>{
                        if(datas.body.code=='001'){
                            this.data1=datas.body.result;
                        }else if(datas.body.code=='002'){
                            this.$Message.success('提交信息出错p!');
                        }else if(datas.body.code=='997'||datas.body.code=='998'){
                            this.store.state.user.companyId=null;
                            this.store.state.user.companyName=null;
                            this.store.state.allInfor=null;
                            this.$Message.error('登陆超时或未登陆,请登陆!');
                            this.myRouter.go({path:'/login'});
                        }
                    },
                    (error)=>{
                        this.$Message.success('网络问题!');
                    }   
                 );
         })
        }
    }
</script>
<style>
	.ivu-table-sort, th .ivu-table-cell{
		width: 100%;
	}
</style>
